{template 'common/header'}
<style>
	.main{
		margin: 0 0 30px 0;
	}
</style>
<ul class="nav nav-tabs">
    <li {if $op == 'index'}class="active"{/if}><a href="{php echo $this->createWebUrl('user', array('op' => 'index'))}">用户管理</a></li>
</ul>
{if $op=='index'}
<div class="main">
	<div class="panel panel-default">
		<div class="panel-heading">筛选</div>
		<div class="panel-body">
			<form action="../index.php" method="get" class="form-inline" role="form">
				<input type="hidden" name="c" value="site" />
	            <input type="hidden" name="a" value="entry" />
	            <input type="hidden" name="m" value="lanye_wd" />
	            <input type="hidden" name="do" value="user" />
	            <input type="hidden" name="op" value="index" />
				<div class="form-group">
					<label for="mobile">手机号码</label>
					<input class="form-control" name="mobile" placeholder="请输入手机号码关键字" type="text" value="{$mobile}">
				</div>
				<div class="form-group">
					<label for="name">真实姓名</label>
					<input type="text" name="username" class="form-control"  placeholder="请输入真实姓名关键字" value="{$username}" />
				</div>
				<button type="submit" class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
			</form>
		</div>
	</div>	
    <div class="panel panel-default">
        <div class="table-responsive panel-body">
            <form action="" method="post" class="form-horizontal form" onsubmit="return formcheck(this)">
                <table class="table table-hover" style="margin-top: 15px;">
                    <thead class="navbar-inner">
                    <tr>
                        <th>用户UID</th>
                        <th>用户昵称</th>
                        <th>账户金额</th>
                        <th>真实姓名</th>
                        <th>手机号码</th>
                        <th>身份证</th>
                        <th>第一级</th>
                        <th>第二级</th>
                        <th>第三级</th>
                        <th>提现记录</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="level-list">
                    {loop $list $row}
                    <tr>
						<td>
							{$row['uid']}
						</td>
						<td>
							{$row['nickname']}
						</td>
						<td>{$row['money']}</td>
						<td>{if !empty($row['name'])}{$row['name']}{else}----{/if}</td>
						<td>{if !empty($row['mobile'])}{$row['mobile']}{else}----{/if}</td>
						<td>{if !empty($row['certify'])}{$row['certify']}{else}----{/if}</td>
	                   <td>  
                            {if $row['leader1']==0}
                                无
                            {else}
                             <a  class="btn btn-default btn-sm"title="用户详情" href="{php echo $this->createWebUrl('user', array('op' => 'info', 'uid' => $row['leader1']))}">
                                {php echo $this->user($row['leader1'])['name']}</a>
                            {/if}
                        </td>
						<td>  
                            {if $row['leader2']==0}
                                无
                            {else}
                             <a  class="btn btn-default btn-sm"title="用户详情" href="{php echo $this->createWebUrl('user', array('op' => 'info', 'uid' =>$row['leader2']))}">{php echo $this->user($row['leader2'])['name']}</a>
                            {/if}
                        </td>
						<td>
                            {if $row['leader3']==0}
                                无
                            {else}
                             <a  class="btn btn-default btn-sm"title="用户详情" href="{php echo $this->createWebUrl('user', array('op' => 'info', 'uid' => $row['leader3']))}">{php echo $this->user($row['leader3'])['name']}</a>
                            {/if}
                        </td>
                       <td>
                            <a class="btn btn-default btn-sm" href="{php echo $this->createWebUrl('user', array('op' => 'index2', 'uid' => $row['uid']))}" title="提现记录"><i>提现记录</i></a>
                        </td>
                        <td>
                         <a class="btn btn-default btn-sm" href="{php echo $this->createWebUrl('user', array('op' => 'usergroup', 'uid' => $row['uid']))}" title="提现记录"><i>修改用户组别</i></a>
                            <a class="btn btn-default btn-sm" onclick="return confirm('是否要删除？');return false;" href="{php echo $this->createWebUrl('user', array('op' => 'delete', 'id' => $row['id']))}" title="删除"><i class="fa fa-times"></i>
                            </a>
                             
                        </td>
                    </tr>
                    {/loop}
                    <tr>
                        <td colspan="10">
                            <input type="hidden" name="token" value="{$_W['token']}"/>
                        </td>
                    </tr>
                    </tbody>
                </table>
                
				<div class="pull-right">
					{$pager}
				</div> 
                
            </form>
        </div>
    </div>
</div>
{/if}
{if $op=='info'}
<div class="main">
	<form action="" method="post" class="form-horizontal form" >
    <div class="panel panel-default">
        <div class="panel-heading">用户详情 </div>
        <div class="panel-body">   
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">用户昵称</label>
                <div class="col-sm-9">
                    <input type="text" name="data[nickname]" class="form-control" value="{$item['nickname']}"  readonly="readonly"/>
                </div>
            </div>
             <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">真实姓名</label>
                <div class="col-sm-9">
                    <input type="text" name="data[name]" class="form-control" value="{$item['name']}" readonly="readonly" />
                </div>
            </div>   
			<div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">账户金额</label>
                <div class="col-sm-9">
                    <input type="text" name="data[money]" class="form-control" value="{$item['api']}" readonly="readonly" />
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">手机号码</label>
                <div class="col-sm-9">
                    <input type="text" name="data[mobile]" class="form-control" value="{$item['mobile']}"  readonly="readonly"/>
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">身份证</label>
                <div class="col-sm-9">
                    <input type="text" name="data[certify]" class="form-control" value="{$item['certify']}"  readonly="readonly"/>
                </div>
            </div>
<!--             <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">一级</label>
                <div class="col-sm-9">
                    <input type="text" name="data[certify]" class="form-control" value="{php echo $this->user($item['leader1'])['name']}"  readonly="readonly"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">二级</label>
                <div class="col-sm-9">
                    <input type="text" name="data[certify]" class="form-control" value="{php echo $this->user($item['leader2'])['name']}" readonly="readonly" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">三级</label>
                <div class="col-sm-9">
                    <input type="text" name="data[certify]" class="form-control" value="{php echo $this->user($item['leader3'])['name']}" readonly="readonly" />
                </div>
            </div> -->
        </div>
    </div>
	</form>
</div>
{/if}
{if $op == 'index2'}
<div class="main">
    <div class="panel panel-default">
        <div class="table-responsive panel-body">
            <form action="" method="post" class="form-horizontal form" onsubmit="return formcheck(this)">
                <table class="table table-hover" style="margin-top: 15px;">
                    <thead class="navbar-inner">
                    <tr>
                        <th class="text-center">记录ID</th>
                        <th class="text-center">用户昵称</th>
                        <th class="text-center">提现金额</th>
                        <th class="text-center">真实姓名</th>
                        <th class="text-center">联系电话</th>
                        <th class="text-center">支付宝</th>
                        <th class="text-center">状态</th>
                        <th class="text-center">时间</th>
                    </tr>
                    </thead>
                    <tbody id="level-list">
                    {loop $list $row}
                    <tr>
                        <td class="text-center">
                            {$row['id']}
                        </td>
                        <td class="text-center">
                            {php echo $this->users($row['uid'])['nickname']}
                        </td>
                        <td class="text-center">
                            {$row['money']}
                        </td>
                        <td class="text-center">{$row['name']}</td>
                        <td class="text-center">
                            {$row['mobile']}
                        </td>
                        <td class="text-center">
                            {$row['alipay']}
                        </td>
                        <td class="text-center">    
                            {if $row['status'] == 3}
                            <small class="label label-danger">已拒绝</small>
                            {elseif $row['status'] == 2}
                            <small class="label label-success">已打款</small>
                            {else}
                            <small class="label label-default">未处理</small>
                            {/if}
                        </td>
                        <td class="text-center">
                            <small>{php echo date('Y-m-d H:i',$row['createtime'])}</small>
                        </td>
                    </tr>
                    {/loop}
                    <tr>
                        <td colspan="10">
                            <input type="hidden" name="token" value="{$_W['token']}"/>
                        </td>
                    </tr>
                    </tbody>
                </table>
                
                
                <div class="pull-right">
                    {$pager}
                </div>
                
            </form>
        </div>
    </div>
  
</div>
{/if}
{if $op == 'usergroup'}
<div class="main">
    <form action="" method="post" class="form-horizontal form" >
    <div class="panel panel-default">
        <div class="panel-heading">修改用户组别</div>
        <div class="panel-body">   
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">原用户组别</label>
                <div class="col-sm-9">
                    <input type="text" name="group" class="form-control" {if $user_group} value="{$user_group['name']}"{else} value="还没有用户组别请添加" {/if} readonly="readonly" />
					<div style="color: red !important;">&#x6B64;&#x6E90;&#x7801;&#x7531;&#xFF1A;&#x65B0;&#x777F;&#x6E90;&#x7801;&#x793E;&#x533A;www.010xr.com&#x53D1;&#x5E03;</div>
                </div>
            </div>
            <input type="hidden" name="user_id" value="{$user_lsit['id']}">
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">请选择属用户组别</label>
                <div class="col-sm-9">
                    <select name="group_id" class="form-control">
                         <option value="0">请选择</option>
                        {loop $group $row}
                        <option value="{$row['id']}" {if $row['id']==$user_group['group']}selected{/if}>{$row['name']}</option>
                        {/loop}
                    </select>
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-12">
            <input name="submit" type="submit" value="提交" class="btn btn-primary ">
            <input type="hidden" name="token" value="{$_W['token']}"/>
            <input type="hidden" name="id" value="{$item['id']}"/>
        </div>
    </div>
    </form>
</div>
<script>

</script>
{/if}
{template 'common/footer'}